package com.gjsh.a_private;

public class Person {
    // 添加private私有属性,只能自己包里面访问
    private String name;
    private int age;

    // 为name添加set/get方法
    public void setName(String xingMing) {
        name = xingMing;
    }

    public String getName() {
        return name;
    }

    // 为age添加set/get方法
    public  void seAge(int nianling){
        if(nianling>0){
            age = nianling;
        }else {
            return;
        }
    }

    public int getAge(){
        return age;
    }
}
